/*
 * @Description: 
 * @Author: zoe
 * @Date: 2024-09-25 19:48:52
 * @LastEditors: rendc
 * @LastEditTime: 2024-09-25 20:16:26
 */
import java.util.Scanner;
public class Student{
    //创建scanner对象用于读取键盘输入
    Scanner scanner = new Scanner(System.in);

    //提示用户输入学生信息
    System.out.println("请输入学生信息：");
    String student = scanner.nextLine();

    //使用冒号(:)作为分隔符拆分字符串
    String[] parts = student.split(":");
    //检查拆分后的数组的长度是否为3
    if(parts.length == 3){
        String id = parts[0];
        String name = parts[1];
        Stirng score = parts[2];
        
        //输出拆分后的信息
        System.out.println("学号：" + id);
        System.out.println("姓名：" + name);
        System.out.println("分数：" + score);
    }else{
        System.out.println("输入信息有误！");
    }
    //关闭scanner
    scanner.close(); 
}
